#include "dyn_planarBilliard_nextImpactDiff.h"

NextImpactDiff::NextImpactDiff(Functor &_boundary,
                               Functor &_diffBoundary,
                               double _impactPoint,
                               double _direction)
    : boundary(_boundary), diffBoundary(_diffBoundary)
{
    setImpactPoint(_impactPoint);
    setDirection(_direction);
}

double NextImpactDiff::operator ()(const double x)
{
    return -diffBoundary(x)*sin(direction-x)+boundary(x)*cos(direction-x);
}
